let mysqlpool = require("../../model/connect");
const postCommunityControler=async (request,response)=>{
   
    //取出表单post传值的值
    console.log(request.body);
    let username=request.body.username; 
    let city=request.body.city; 
    let community=request.body.community; 
    
   
    let sql_insert = `insert into area (username,city,community) values ("${username}","${city}","${community}")`;
    await mysqlpool.query(sql_insert, (err,res)=>{
        
        if( !res.length ){
            response.send({ msg: "提交成功", areaMsg: {city,community} });
        }
        else{
            response.send({msg: "提交失败"});
        }
     })
    
}
module.exports=postCommunityControler